package com.cnhis.cloudhealth.clinical.medical.base.service;


import com.alibaba.dubbo.config.annotation.Service;
import com.cnhis.cloudhealth.clinical.medical.base.bo.MpatientInfoBo;
import com.cnhis.cloudhealth.commons.util.DateUtil;

import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

@Service
public class MpatientInfoImpl implements IMpatientInfo {
    @Autowired
    private MpatientInfoBo mpatientInfoBo;
    /**
     * @Description:(病人列表)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public Map<String, Object> findPatientList(Map<String, Object> map) throws Exception {
    	String lSDate = (String) map.get("lSDate");
    	String lEDate = (String) map.get("lEDate");
    	Integer syspar = DateUtil.timeRange(lSDate,lEDate);
    	map.put("syspar", syspar);/**0在线表 1离线表**/
    	
        return mpatientInfoBo.findPatientList(map);
    }

    /**
     * @Description:(病人详细信息)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:33
     */
    public Map<String, Object> findPatientInfo(Map map) throws Exception {
        return mpatientInfoBo.findPatientInfo(map);
    }

    /**
     * @Description:(病人详细信息住院)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:33
     */
    public Map<String, Object> findHosPatientInfo(Map map) throws Exception {
        return mpatientInfoBo.findHosPatientInfo(map);
    }
    /**
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @Description:(病人医嘱内容 門診)
     * @author chengshaowei
     * @date 2016/9/19 10:33
     */
    public Map<String, Object> findOutAdvice(Map map) throws Exception {
        return mpatientInfoBo.findOutAdvice(map);
    }

    /**
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @Description:(病人医嘱内容 住院)
     * @author chengshaowei
     * @date 2016/9/19 10:33
     */
    public Map<String, Object> findHosAdvice(Map map) throws Exception {
        return mpatientInfoBo.findHosAdvice(map);
    }

    /**
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @Description:(医技项目对应收费项目记录 门诊)
     * @author chengshaowei
     * @date 2016/9/19 10:37
     */
    public Map<String, Object> findOutCharge(Map map) throws Exception {
        return mpatientInfoBo.findOutCharge(map);
    }

    /**
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @Description:(医技项目对应收费项目记录 住院)
     * @author chengshaowei
     * @date 2016/9/19 10:37
     */
    public Map<String, Object> findHosCharge(Map map) throws Exception {
        return mpatientInfoBo.findHosCharge(map);
    }

    /**
     * @Description:(医技项目执行明细记录)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:37
     */
    public Map<String, Object> findDetail(Map map) throws Exception {
        return mpatientInfoBo.findDetail(map);
    }


    /**
     * @Description:(查询科室信息)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:37
     */
    public Map<String, Object> findDepartment(Map map) throws Exception {
        return mpatientInfoBo.findDepartment(map);
    }

    /**
     * @Description:(查询参数信息)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:37
     */
    public Map<String, Object> findParameters(Map map) throws Exception {
        return mpatientInfoBo.findParameters(map);
    }

    /**
     * @Description:(医技病人列表，通过费用查询)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public Map<String, Object> findMcostList(Map map) throws Exception {
    	String lSDate = (String) map.get("lSDate");
    	String lEDate = (String) map.get("lEDate");
    	Integer syspar = DateUtil.timeRange(lSDate,lEDate);
    	map.put("syspar", syspar);/**0在线表 1离线表**/
        return mpatientInfoBo.findMcostList(map);
    }


    /**
     * @Description:(医技病人列表，混合模式查询，医嘱+费用 0)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public Map<String, Object> findMhybridList(Map map) throws Exception {
    	String lSDate = (String) map.get("lSDate");
    	String lEDate = (String) map.get("lEDate");
    	Integer syspar = DateUtil.timeRange(lSDate,lEDate);
    	map.put("syspar", syspar);/**0在线表 1离线表**/
        return mpatientInfoBo.findMhybridList(map);
    }
    /**
     * @Description:(医技病人列表，混合模式查询，医嘱+费用 other)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public Map<String, Object> findOtherList(Map map) throws Exception {
        return mpatientInfoBo.findOtherList(map);
    }

    /**
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @Description:(修改附属医嘱费用明细状态)
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public Map<String,Object> costDetail(Map<String, Object> map) throws Exception {
        return mpatientInfoBo.costDetail(map);
    }

    /**
     * @Description:(员工检索 other)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public Map<String, Object> findStaff(Map map) throws Exception {
        return mpatientInfoBo.findStaff(map);
    }

    /**
     * 院内消息查询
     *
     * @param map
     * @param currPage
     * @param pageSize
     * @return
     * @throws Exception
     */
    public Map<String, Object> yuanNeiNotice(Map<String, Object> map, int currPage, int pageSize) throws Exception {
        return mpatientInfoBo.yuanNeiNotice(map, currPage, pageSize);
    }

    /**
     * chengshaowei 2017/8/15 14:10
     *
     * @param map
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @Title: findSumMoney
     * @Description: （计算医嘱费用）
     */
    public Map<String, Object> findSumMoney(Map<String, Object> map) throws Exception {
        return mpatientInfoBo.findSumMoney(map);
    }


    /**
     * 查询已经扣过费用的项目名称
     * @Title: findYetItem   
     * @Description: TODO(方法功能描述)
     * @param: @param map
     * @param: @return
     * @param: @throws Exception
     * @return: Map<String,Object>      
     * @throws
     */
	public List<Map<String, Object>> findYetItem(Map<String, Object> map)throws Exception {
		return mpatientInfoBo.findYetItem(map);
	}
}
